{extend name="member/common/cms_member_layout" /}

{block name="content"}

<div class="cms-member-layout">
  <div class="cms-member-sidebar">

      <!--sidebar-->
      {include file="member/memberarticle/member_sidebar"}

    <a href="/member/Publisharticle/publish_article" class="contribute-btn">发布文章</a>
    <ul class="cms-member-menu">
      <li <?php echo $cur_action=='article_list'?' class="current"':'';?>><a href="/member/Memberarticle/article_list"><i class="a"></i>我的文章</a></li>
      <li <?php echo $cur_action=='draft_list'?' class="current"':'';?>><a href="/member/Memberarticle/draft_list"><i class="b"></i>草稿箱</a></li>
      <li <?php echo $cur_action=='recycle_list'?' class="current"':'';?>><a href="/member/Memberarticle/recycle_list"><i class="c"></i>回收站</a></li>
    </ul>
  </div>
  <div class="cms-member-main">
    <table class="cms-member-table">
      <thead>
        <tr>
          <th class="w30">文章编号</th>
          <th>标题</th>
          <th class="w90">日期</th>
          <th class="w90">状态</th>
          <th class="w60">点击数</th>
          <th class="w90">操作</th>
        </tr>
        <tr>
          <td colspan="10">
              <form action="" method="get">
              <input name="act" type="hidden" value="member_article" />
              <?php if($cur_action == 'article_list') { ?>
              <select name="article_state">
                <option value="">全部</option>
                <option value="3" <?php echo I('article_state') == '3'?'selected':'';?>>已发布</option>
                <option value="2" <?php echo I('article_state') == '2'?'selected':'';?>>待审核</option>
              </select>
              <?php } ?>
              <input name="title" type="text" value="<?php echo I('title');?>" placeholder="输入标题关键字" class="text" />
              <input style="display: table-cell"; type="submit" class="search-btn" value="搜索" />
            </form></td>
        </tr>
      </thead>
      <?php if(!empty($cms_article_list) && is_array($cms_article_list)) {?>
      <tbody>
        <?php foreach($cms_article_list as $value) {?>
        <?php $article_url = getCMSArticleUrl($value['article_id']);?>
        <tr>
          <td><?php echo $value['article_id'];?></td>
          <td><dl class="article-info">
              <dt class="title" title="<?php echo $value['article_title'];?>"><a href="<?php echo $article_url;?>" target="_blank"><?php echo $value['article_title'];?></a></dt>
              <dd class="thumb" title="封面"><a href="<?php echo $article_url;?>" target="_blank"> <img src="<?php echo getCMSArticleImageUrl($value['article_attachment_path'], $value['article_image']);?>" width="40px"  alt="" class="t-img"/></a></dd>
              <dd class="abstract" title="摘要：<?php echo $value['article_abstract'];?>"><?php echo $value['article_abstract'];?></dd>
            </dl></td>
          <td><?php echo date('Y-m-d',$value['article_publish_time']);?></td>
          <td><?php echo $article_state_list[$value['article_state']];?></td>
          <td><?php echo $value['article_click'];?></td>
          <td class="handle">
            <?php if($value['article_state'] != '3') {?>
              <a href="<?php echo $article_url;?>" target="_blank" style="color:#06C;">浏览</a>
              <?php } else { ?>
              <a href="<?php echo $article_url;?>" target="_blank" style="color:#06C;">浏览</a>
              <a href="/member/Memberarticle/article_edit?article_id=<?php echo $value['article_id'];?>" style="color:#F90;" >编辑</a>
              <?php } ?>
            <?php if($cur_action == 'draft_list') {?>
            <a href="/member/Memberarticle/article_publish?article_id=<?php echo $value['article_id'];?>" onclick="javascript:return confirm('确认发布？发布后无法再修改。')" style="color:#390;">发布</a> <a href="/member/Memberarticle/article_edit?article_id=<?php echo $value['article_id'];?>" style="color:#F90;" >编辑</a> <a href="/member/Memberarticle/article_recycle?article_id=<?php echo $value['article_id'];?>" style="color:#F36;">移除</a>
            <?php } ?>
            <?php if($cur_action == 'recycle_list') {?>
            <a href="/member/Memberarticle/article_draft?article_id=<?php echo $value['article_id'];?>" style="color:#639;">还原</a> <a href="/member/Memberarticle/article_drop?article_id=<?php echo $value['article_id'];?>" onclick="javascript:return confirm('确认删除？')" style="color:#F00;">删除</a>
            <?php } ?></td>
        </tr>
            <?php if($cur_action == 'draft_list') {?>
            <?php if(!empty($value['article_verify_reason'])) { ?>
            <tr>
                <td colspan="20"><strong class="fl" style="color: #F00;">审核结果：未通过平台审核，<?php echo $value['article_verify_reason'];?>。请根据审核意见进行修改编辑后再次提交。</strong></td>
            </tr>
            <?php } ?>
            <?php } ?>
        <?php } ?>
      </tbody>
      <tfoot>
        <tr>
          <td colspan="20"><div class="pagination"> <?php echo $show_page;?> </div></td>
        </tr>
      </tfoot>
      <?php } else { ?>
      <tbody>
        <tr>
          <td colspan="20"><div class="no-record"><i></i>没有符合条件的记录</div></td>
        </tr>
      </tbody>
      <?php } ?>
    </table>
  </div>
</div>
<script type="text/javascript">
$(window).load(function() {
	$(".article-info .t-img").VMiddleImg({"width":40,"height":32});
});
</script> 

{/block}